//
//  BDShopCouponsModel.m
//  BadBoy
//
//  Created by wen on 2017/7/4.
//  Copyright © 2017年 com.8xiong. All rights reserved.
//

#import "BDShopCouponsModel.h"

@implementation BDShopCouponsModel

+ (NSDictionary *)mj_replacedKeyFromPropertyName{
    return @{@"my_id":@"id",
             @"city_id":@"shop.city_id"};
}

- (NSString *)startTimeString{
    if (!_startTimeString) {
        NSDate *date = [NSDate dateWithTimeIntervalSince1970:self.start_at];
        NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
        [dateFormat setDateFormat:@"yyyy-MM-dd"];//设定时间格式
        NSTimeZone *timeZone = [NSTimeZone localTimeZone];
        [dateFormat setTimeZone:timeZone];
        _startTimeString = [dateFormat stringFromDate:date];
    }
    return _startTimeString;
}

- (NSString *)endTimeString{
    if (!_endTimeString) {
        NSDate *date = [NSDate dateWithTimeIntervalSince1970:self.end_at];
        NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
        [dateFormat setDateFormat:@"yyyy-MM-dd"];//设定时间格式
        NSTimeZone *timeZone = [NSTimeZone localTimeZone];
        [dateFormat setTimeZone:timeZone];
        _endTimeString = [dateFormat stringFromDate:date];
    }
    return _endTimeString;
}
@end
